#include "affairs.h"
#include "connection.h"
#include <QApplication>
#include <QDir>
#include <QMessageBox>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
	QDir::setCurrent(QApplication::applicationDirPath());

    // open database
    Connection connection;
    if(!connection.createConnection())
    {
        QMessageBox::warning(NULL,
            QObject::tr("affairs"),
            QObject::tr("don't open database!"),
            QMessageBox::Cancel
        );
        return -1;
    }

    affairs w;
    w.show();

    return a.exec();
}
